import "./tools/liveUrl"

import * as React from "react"
import { render } from "react-dom"
import { BrowserRouter } from "react-router-dom" //HashRouter  BrowserRouter

import { AppContainer } from "react-hot-loader"
import { Provider } from "mobx-react"

import { useStrict } from "mobx"
import App from "./app"

import stores from "./stores"

import "babel-polyfill"

// For Mobile
import "./style/reset.css"
import "./tools/initRem"

import "./style/common.less"

// useStrict(true)

const main = stores => (
  <AppContainer>
    <BrowserRouter>
      <Provider {...stores}>
        <App />
      </Provider>
    </BrowserRouter>
  </AppContainer>
)

render(main(stores), document.getElementById("root"))
window["stores"] = stores
// Hot Module Replacement API
if (process.env.NODE_ENV === "development" && (module as any).hot) {
  ;(module as any).hot.accept(App, () => {
    render(main(stores), document.getElementById("root"))
  })
}
